﻿@model PasswordRecoveryModel
@using Grand.Web.Models.Customer;
@inject IPageHeadBuilder pagebuilder
@{
    Layout = "_ColumnsOne";

    //title
    pagebuilder.AddTitleParts(T("PageTitle.PasswordRecovery").Text);
}
<div class="page password-recovery-page">
    <h1 class="generalTitle h2">@T("Account.PasswordRecovery")</h1>
    @if (!String.IsNullOrEmpty(Model.Result))
    {
        <div class="result alert alert-info mt-3">
            @Model.Result
        </div>
    }
    @if (!Model.Send)
    {
        <form asp-route="PasswordRecovery" method="post" v-on:submit.prevent="validateBeforeSubmitParam($event, 'send-email')">
            <input type="hidden" asp-for="DisplayCaptcha" />
            <div asp-validation-summary="ModelOnly" class="message-error"></div>
            <div class="form-group">
                <label asp-for="Email" class="col-form-label">@T("Account.PasswordRecovery.Email"):</label>
                <input asp-for="Email" class="form-control email" v-validate="'required|email'" />
                <span v-if="veeErrors.first('Email')" class="field-validation-error">@T("account.PasswordRecovery.email.required")</span>
                <span asp-validation-for="Email"></span>
            </div>
            @if (Model.DisplayCaptcha)
            {
                <div class="form-group">
                    <div class="captcha-box">
                        <captcha />
                    </div>
                </div>
            }
            <b-row class="text-xs-center">
                <b-col cols="12">
                    <input type="submit" class="btn btn-secondary password-recovery-button" value="@T("Account.PasswordRecovery.RecoverButton")" />
                </b-col>
            </b-row>

            <div class="alert-info mt-3 alert">
                @T("Account.PasswordRecovery.Tooltip")
            </div>
        </form>
    }
</div>
